// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

int t, n;

int test(int x) {
    for (int i=0; i<=29; ++i) {
        if ((1 << i) == x)
            return i;
    }
    return -1;
}

int cnt[40];

int main(int argc, char const *argv[]) {
    // code
    scanf("%d", &t);
    for (int kk=0; kk<t; ++kk) {
        scanf("%d", &n);
        memset(cnt, 0, sizeof cnt);
        for (int i=0; i<n; ++i) {
            int x;
            scanf("%d", &x);
            cnt[test(x)]++;
        }
        for (int i=0; i<11; ++i) {
            cnt[i+1] += cnt[i] / 2;
            cnt[i] %= 2;
        }
        if (cnt[11]) {
            puts("YES");
        } else puts("NO");
    }
    return 0;
}
